package com.linkai.mt_2021_11;

import java.util.Scanner;

/**
 * @Description: 小美的算法竞赛
 *                思路：定义2个指针来遍历time数组即可
 * @Author: 林凯
 * @Date: 2021/10/10 11:14
 */
public class Main02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long m = sc.nextLong();
        long time[] = new long[n];
        for (int i = 0; i < n; i++) {
            time[i] = sc.nextLong();
        }
        long num = 0;
        // 定义2个指针来遍历 time 数组
        for (int i = 0; i < n; i++) {
            int j;
            for (j = i + 1; j < n; j++) {
                if (time[i] + time[j] <= m) {
                    num++;
                }
            }
        }
        System.out.println(num);
    }
}
